<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@include file="../comum/CabecalhoTaglibComum.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>PAQS | Programa de Avaliação de Qualidade de Software</title>
<style>
<jsp:include page="/comum/geral.css"/>
</style> 
</head>
<f:view>
<body>
	<h:form id="projetoForm">
<%@include file="../comum/CabecalhoComum.jsp"%>
<%@include file="../comum/CabecalhoUsuarioComum.jsp"%>
<div class="corpo">
<%@include file="../comum/Mensagem.jsp"%>
	<div class="caminho">
		<h:outputText value="Onde você está: "></h:outputText>
		<h:commandLink value="Lista de Projetos" action="#{pc_MetricaEdit.voltarListaProjetos}"></h:commandLink>
		<h:outputText value=" >> "></h:outputText>
		<h:commandLink value="Projeto #{pc_MetricaEdit.projeto.nome}" action="#{pc_SubcaracteristicaEdit.voltarProjetoEdit}"></h:commandLink>
		<h:outputText value=" >> "></h:outputText>
		<h:commandLink value="Iterações" action="#{pc_MetricaEdit.voltarListIteracao}"></h:commandLink>
		<h:outputText value=" >> "></h:outputText>
		<h:commandLink value="#{pc_MetricaEdit.iterNumero}ª iteracao" action="#{pc_SubcaracteristicaEdit.voltarIteracaoEdit}"/>
		<h:outputText value=" >> "></h:outputText>
		<h:commandLink value="#{pc_MetricaEdit.nomeQualidade}" action="#{pc_SubcaracteristicaEdit.voltarQualidadeSelect}"/>
		<h:outputText value=" >> "></h:outputText>
		<h:commandLink value="Característica" action="#{pc_MetricaEdit.voltarCaracteristicaEdit}"/>
		<h:outputText value=" >> "></h:outputText>
		<h:commandLink value="Subcaracterística" action="#{pc_MetricaEdit.voltarSubcaracteristicaEdit}"/>
		<h:outputText value=" >> "></h:outputText>
		<h:outputText value="Métrica"></h:outputText>

		<h:dataTable var="subcaracteristica" value="#{pc_MetricaEdit.listaSubcaracteristicas}">
			<h:column>
				<h:outputText value="#{subcaracteristica.nome}"></h:outputText>
				<h:dataTable value="#{subcaracteristica.metricas}" var="metrica" columnClasses="dataTableHeader">
					<h:column>
						<f:facet name="header">
							<h:outputText value="Métrica"></h:outputText>
						</f:facet>
						<h:outputText value="#{metrica.nome}"></h:outputText>
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="Nota"></h:outputText>
						</f:facet>
						<h:inputText value="#{metrica.nota}" disabled="#{!metrica.ativo}"></h:inputText>
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="Fórmula"></h:outputText>
						</f:facet>
					<h:dataTable value="#{metrica.formulas}" var="formula" columnClasses="dataTableHeader">
						<h:column>
							<h:outputText value="#{formula.formula}"></h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="A"></h:outputText>
							</f:facet>
							<h:outputText value="#{formula.campoA}"></h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="B"></h:outputText>
							</f:facet>
							<h:outputText value="#{formula.campoB}"></h:outputText>
						</h:column>
					</h:dataTable>
					</h:column>
						<h:column>
							<h:selectBooleanCheckbox id="checkbox" value="#{metrica.ativo}" onchange="submit();"></h:selectBooleanCheckbox>
						</h:column>
				</h:dataTable>
			</h:column>
		</h:dataTable>
		<h:commandButton value="OK" action="#{pc_MetricaEdit.salvar}"></h:commandButton>
	</div>
</div>
<%@include file="../comum/RodapeComum.jsp"%>
</h:form>
</body>
</f:view>
</html>